<template>
  <div class="grandson">
    孙子
    <div>{{ money }}</div>
    <button @click="money--">-1</button>
  </div>
</template>

<script setup lang="ts">
import {inject, onMounted, ref} from "vue";


  const money = inject('money', ref<number>(0));
</script>



<style scoped>
.grandson {
  background-color: gold;
  margin: auto;
  width: 80%;
  height: 60%;
}
</style>

<script lang="ts">

export default {
  name: "grandson.vue"
}
</script>